﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Dycox.Xml
{
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
    public class XmlSchemaAttribute : Attribute
    {
        public XmlSchemaAttribute(string ns, string res, params string[] dep)
        {
            Namespace = ns;
            ResourceName = res;

            _dependencies = new System.Collections.Specialized.StringCollection();
            if (dep != null)
            {
                _dependencies.AddRange(dep);
            }
        }

        private string _namespace;

        public string Namespace
        {
            get { return _namespace; }
            set
            {
                if (string.IsNullOrWhiteSpace(value))
                    throw new ArgumentNullException("Namespace");
                _namespace = value;
            }
        }

        private string _resourceName;

        public string ResourceName
        {
            get { return _resourceName; }
            set
            {
                if (string.IsNullOrWhiteSpace(value))
                    throw new ArgumentNullException("ResourceName");

                _resourceName = value;
            }
        }


        private System.Collections.Specialized.StringCollection _dependencies;

        public System.Collections.Specialized.StringCollection Dependencies
        {
            get { return _dependencies; }
        }

        private Assembly _assembly;

        public Assembly Assembly
        {
            get { return _assembly; }
            internal set { _assembly = value; }
        }

    }
}
